<template>
    <div>
  <el-row class="tac">
      <el-col :span="24">
        <el-menu 
          :default-adctive="this.$router.path"
          active-text-color="#ffd04b"
          background-color="#545c64"
          class="el-menu-vertical-demo asidebar"
          default-active="2"
          text-color="#fff"
          @open="handleOpen"
          @close="handleClose"
          router
        >
          <el-menu-item index="/test/home">
            <el-icon><HomeFilled /></el-icon>
            <span>首页</span>
          </el-menu-item>
          <el-sub-menu index="2">
            <template #title>
              <el-icon><location /></el-icon>
              <span>考试</span>
            </template>
  
              <el-menu-item index="/test/testing">进行中考试</el-menu-item>
              <el-menu-item index="/test/passtest">历史考试</el-menu-item>
  
  
              <el-menu-item index="/test/testcon">考试管理</el-menu-item>
          </el-sub-menu>
  
          <el-sub-menu  index="3">
              <template #title>
              <el-icon><location /></el-icon>
              <span>用户管理</span> 
              </template>
               <el-menu-item index="/test/user">查看用户</el-menu-item>
  
             
          </el-sub-menu>
          <el-menu-item index="/test/punish">
            <el-icon><setting /></el-icon>
            <span>舞弊公示</span>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
    </div>
    
  </template>
  
  <script>
      export default {
          name: "",
          methods: {
              handleOpen(key, keyPath) {
                  console.log(key, keyPath);
              },
              handleClose(key, keyPath) {
                  console.log(key, keyPath);
              }
          }
      }
  </script>
  
  <style scoped>
      .el-menu-item {
          height: 60px;
  
      }
      .el-menu {
          border-right: 0;
          /* 设计89%屏幕高度*/
          height: 89vh;
      }
  
      i {
          padding-right: 10px;
      }
  
      .subgroup {
          padding-left: 40px;
      }
      .tac{
        height: 100%;
        background-color: #545c64;
      }
  
  </style>